package com.example.springboot_system.Controller;

import com.example.springboot_system.service.TakingDrugService;
import com.example.springboot_system.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/takeingDrug")
public class TakingDrugController {

    @Autowired
    private TakingDrugService takingDrugService;

    @RequestMapping("/getMedicalRecord")
    @ResponseBody
    public ResponseResult getMedicalRecord(String prescriptionNum, HttpSession session){
        ResponseResult result = takingDrugService.getMedicalRecord(prescriptionNum, session);
        return result;
    }

    @RequestMapping("/finishTakeDrug")
    @ResponseBody
    public ResponseResult finishTakeDrug(String prescriptionNum, HttpSession session){
        ResponseResult result = takingDrugService.finishTakeDrug(prescriptionNum, session);
        return result;
    }

}
